﻿using System;
using System.Collections.Generic;

namespace Pixels
{
    class Loader : Sargon.State
    {
        public Loader() {
            register_method(Sargon.Trigger.initialized, loadAll);
        }

        void loadAll() {
            Sargon.Assets.correct_path();
            var rm = new Sargon.Loaders.LoadManager();
            rm.scanDirectory("Assets//");
            rm.allTasksProcessed += managerLoadedAll;
            rm.execute();
        }

        void managerLoadedAll() {
            if (Complete != null) Complete();
        }

        public event Action Complete;

    }
}
